﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Google.Spreadsheets;
using Google.GData.Spreadsheets;

namespace WoodRobotics.PasswordKeeper.ModelView
{
    
    public class Password
    {

        #region Constructor 
        public Password()
        {
        }
        #endregion
        
        #region Properties
        public ListEntry Row { get; set; }
        #endregion
        
        public string Source
        {
            get { return Row.Elements[0].Value; }
            set
            {
                Row.Elements[0].Value = value;
                Row = (ListEntry)Row.Update();
            }
        }
        public string UserName
        {
            get { return Row.Elements[1].Value; }
            set
            {
                Row.Elements[1].Value = value;
                try
                {
                    Row = (ListEntry)Row.Update();
                }
                catch { }
            }
        }
        public string Pass
        {
            get { return Row.Elements[2].Value; }
            set
            {
                Row.Elements[2].Value = value;
                Row = (ListEntry)Row.Update();
            }
        }
        
    }
    
}